package org.ch02.job.test03;

/**
 * @author XCH
 * @date 2025 - 03 - 17
 */
public class Student {
    private String name;
    private int age;
    private float weight;
    private static final double PI = 3.14;

    public Student() {
    }

    public Student(String name, int age, float weight) {
        this.name = name;
        this.age = age;
        this.weight = weight;
    }

    public Student(String name,int age,Double weight){
        this.name = name;
        this.age = age;
        this.weight = weight.floatValue();
    }

    public Student(String name, Float weight) {
        this.name = name;
        this.age = 18;
        this.weight = weight;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public float getWeight() {
        return weight;
    }

    public void setWeight(float weight) {
        this.weight = weight;
    }

    public void hello() {
        System.out.println("你好!");
    }

    private void sleep() {
        System.out.println("睡觉了！");
    }

    public void sayHello(String who) {
        System.out.println("你好," + who);
    }

    public int sum(int i, int j) {
        return i + j;
    }

    @Override
    public String toString() {
        return this.getName()+","+this.getAge()+","+this.getWeight() ;
    }
    public static void study(){
        System.out.println("好好学习");
    }
    public static void study(String sth){
        System.out.println(String.format("好好学习《%s》", sth));

    }
    public void show(){
        System.out.println("Name: " + name);
        System.out.println("Age: " + age);
        System.out.println("Weight: " + weight);
        System.out.println("PI: " + PI);
    }

}
